home *** CD-ROM | disk | FTP | other *** search
/ The Original Shareware 1.1 / The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso / 19 / madtrb14.zip / BBS.PAS < prev    next >
Pascal/Delphi Source File  |  1985-10-05  |  7KB  |  201 lines

  1. {$R-}
  2. {$C-}
  3. {$U-}
  4. program TurboBBS;
  5.  
  6. (*******************************************************************)
  7. (*                                                                 *)
  8. (*  Turbo Bulletin Board System Source Code Master (Main) File     *)
  9. (*                                                                 *)
  10. (*  (c) 1985 by Robert H. Maxwell                                  *)
  11. (*              201 - 2275 West 7th Avenue,                        *)
  12. (*              Vancouver, British Columbia, CANADA                *)
  13. (*              V6K 1Y3                                            *)
  14. (*                                                                 *)
  15. (*  Original System running 300/1200 baud, 24hrs: (604) 738-7811   *)
  16. (*  Written for a Kaypro 2-84 using Rixon 212A Intelligent modem   *)
  17. (*                                                                 *)
  18. (*  If you like this program, it would most appreciated if you     *)
  19. (*  sent $30 to the above address. If you choose to operate a BBS  *)
  20. (*  with it, please forward the details so you can be kept up to   *)
  21. (*  date with changes to the program.                              *)
  22. (*                                                                 *)
  23. (*  The author has released this code to the public domain, but    *)
  24. (*  reserves all rights to the program. No other party is to make  *)
  25. (*  any charge for this program other than for media and special   *)
  26. (*  preparation charges, such as customization,                    *)
  27. (*                                                                 *)
  28. (*  While every reasonable effort has been made to ensure the      *)
  29. (*  reliability of this program, the author assumes no liability   *)
  30. (*  for any damages that may arise from its use.                   *)
  31. (*                                                                 *)
  32. (*  Files required for compile: BBS.PAS     (this file)            *)
  33. (*                              BBS2.INC    (support routines)     *)
  34. (*                              MACHDEP.INC (machine dependent)    *)
  35. (*                              IO.INC      (Input/Output drivers) *)
  36. (*                              MAILSYS.INC (Sections named here)  *)
  37. (*                              FILESYS.INC (XMODEM code here)     *)
  38. (*                                                                 *)
  39. (*  Information files required: BBSINFO.LBR (members listed below) *)
  40. (*                                                                 *)
  41. (*  The following files are created by the program:                *)
  42. (*                              MESSAGES.BBS (Message table)       *)
  43. (*                              FILES.BBS    (Files table)         *)
  44. (*  Clear these periodically: / COMMENTS.BBS (Comments for Sysop)  *)
  45. (*  They can grow quickly...  \ LOG.BBS      (call log file)       *)
  46. (*                              IDS.BBS      (user list)           *)
  47. (*                                                                 *)
  48. (*  .TXT files are WordStar editable; .BBS files are program data  *)
  49. (*  maintained by the program.                                     *)
  50. (*  User SYSOP is automatically given sysop access on system.      *)
  51. (*                                                                 *)
  52. (*******************************************************************)
  53.  
  54. const
  55.   version   = '1.05';
  56.  
  57.   clockin = true;  { Set to false if no clock available. }
  58.   sectsin = true;  { Use to turn section feature on/off. }
  59.   openBBS = true;  { Selects a private or public system. }
  60.  
  61.   messdrive = 'A:';  { Drive on which messages go }
  62.   filedrive = 'B:';  { Drive for storing files }
  63.  
  64.   applying = 'B:BBSINFO\APPLYING.TXT';
  65.   welcome  = 'B:BBSINFO\WELCOME.TXT';   {Info files:    }
  66.   otherBBS = 'B:BBSINFO\BBSLIST.TXT';   {text before "/"}
  67.   helpfile = 'B:BBSINFO\BBSHELP.TXT';   {is name of the }
  68.   sysinfo  = 'B:BBSINFO\SYSINFO.TXT';   {.LBR library   }
  69.   meetings = 'B:BBSINFO\MEETING.TXT';   {file with the  }
  70.   bulletin = 'B:BBSINFO\BULLETIN.TXT';  {member filename}
  71.   filehelp = 'B:BBSINFO\FILEHLP.TXT';   {after the "/". }
  72.   mainmenu = 'B:BBSINFO\MAINMENU.TXT';
  73.   readmenu = 'B:BBSINFO\READMENU.TXT';
  74.   filemenu = 'B:BBSINFO\FILEMENU.TXT';
  75.   editmenu = 'B:BBSINFO\EDITMENU.TXT';
  76.  
  77.   sysop   = 5;  { Access levels }
  78.   reg     = 2;
  79.   newuser = 1;
  80.   twit    = 0;
  81.  
  82.   noecho    = false;
  83.   echo      = true;
  84.   null      = #0;
  85.   abort     = #3;
  86.   bell      = #7;
  87.   bksp      = #8;
  88.   tab       = #9;
  89.   lnfd      = #10;
  90.   cr        = #13;
  91.   pause     = #19;
  92.   esc       = #27;
  93.   space     = ' ';
  94.  
  95. type
  96.   name      = string[14];
  97.   longname  = string[25];
  98.   filbuffer = array[0..127] of byte;
  99.   rate      = (slow,fast);
  100.   line      = string[80];
  101.   person    = string[27];
  102.   long      = string[150];
  103.   sysid     = record
  104.                 user: person;
  105.                 exfl: byte;
  106.                 lsto: name;
  107.                 lstm: integer;
  108.                 pass: name;
  109.                 acc:  byte;
  110.                 clr:  name;
  111.                 bsp:  char;
  112.                 lnf:  char;
  113.                 upc:  boolean;
  114.                 wid:  byte;
  115.               end;
  116.   log       = record
  117.                 who:  integer;
  118.                 when: name;
  119.                 done: name;
  120.               end;
  121.   yesno     = array[boolean] of string[3];
  122.  
  123. const yn: yesno = ('NO','YES');
  124.  
  125. var
  126.   libfile:    file;
  127.   libbuff:    filbuffer;
  128.   libeof:     boolean;
  129.   logfile:    file of log;
  130.   logrec:     log;
  131.   idfile:     file of sysid;
  132.   idrec:      sysid;
  133.   caller:     person;
  134.   password,
  135.   timeon,
  136.   timeoff,
  137.   cs,
  138.   message:    name;
  139.   baud:       rate;
  140.   buffer:     long;
  141.   access:     byte;
  142.   libsects,
  143.   usernum,
  144.   lastmess,
  145.   nextmess,
  146.   charcount,
  147.   lastspace,
  148.   bufpointer,
  149.   width:      integer;
  150.   controls,
  151.   printon,
  152.   local,
  153.   filesopen,
  154.   messopen,
  155.   caps,
  156.   expert:     boolean;
  157.   exitchar, bl, lf, bs     : char;
  158.   sec,   onsec,   offsec   : byte;
  159.   min,   onmin,   offmin   : byte;
  160.   hour,  onhour,  offhour  : byte;
  161.   date,  ondate,  offdate  : byte;
  162.   month, onmonth, offmonth : byte;
  163.   usesec, usemin, usehour  : integer;
  164.  
  165. {$I A:MACHDEP.INC}
  166. {$I A:IO.INC}
  167. {$I A:MAILSYS.INC}
  168. {$I A:FILESYS.INC}
  169. {$I A:BBS2.INC}
  170.  
  171. begin
  172.   exitchar := space;
  173.   local := false;
  174.   resetbuff;
  175.   setup;
  176.   defaults;
  177.   awaitcall;
  178.   repeat
  179.     if clockin then begin
  180.       clock(onmonth, ondate, onhour, onmin, onsec);
  181.       timeon := time(onmonth, ondate, onhour, onmin, onsec);
  182.     end;
  183.     flush;
  184.     resetbuff;
  185.     lineout('TurboBBS version ' + version);
  186.     if cts and not cancelled then outfile(welcome);
  187.     if cts and not cancelled then outfile(bulletin);
  188.     if cts then signon(caller);
  189.     if cts then initmess;
  190.     readmine; {checks for cts internally}
  191.     if cts then command;
  192.     writeln('hung up...');
  193.     endcall;
  194.     if messopen then closemess;
  195.     close(idfile);
  196.     unload;
  197.     defaults;
  198.     awaitcall;
  199.   until exitchar = abort;
  200. end.
  201.